

#include "../../stdafx.h"
#include "NLuaState.h"

NLuaState::NLuaState(void) :
m_pLuaState(NULL)
{
	m_bOK = false;
	if(false == Create()) return;
	m_bOK = true;
}

NLuaState::~NLuaState(void)
{
	Destroy();
}

bool NLuaState::Create(void)
{
	m_pLuaState = luaL_newstate();
	if(NULL == m_pLuaState) return false;
	return true;
}

void NLuaState::Destroy(void)
{
	if(NULL != m_pLuaState){ lua_close(m_pLuaState); m_pLuaState=NULL; }
}